.tool-tester {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin: 0;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #e8e8e8;
}

.tool-info {
  margin-bottom: 24px;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
  position: relative;
  overflow: hidden;
}

.tool-info::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  z-index: 0;
}

.tool-info > * {
  position: relative;
  z-index: 1;
}

.tool-info h3 {
  margin: 0 0 16px 0;
  color: white;
  font-size: 20px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-info p {
  margin: 8px 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  line-height: 1.5;
}

.tool-info p strong {
  color: white;
  font-weight: 600;
}

.test-input {
  margin-bottom: 24px;
}

.test-input label {
  display: block;
  margin-bottom: 12px;
  font-weight: 600;
  color: #495057;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-input label::before {
  content: '⚙️';
  font-size: 16px;
}

.test-input textarea {
  width: 100%;
  padding: 16px;
  border: 2px solid #e8e8e8;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 13px;
  resize: vertical;
  min-height: 120px;
  transition: all 0.3s ease;
  background: #fafafa;
  line-height: 1.5;
}

.test-input textarea:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
  transform: translateY(-1px);
}

.test-input textarea:disabled {
  background-color: #f8f9fa;
  opacity: 0.6;
  cursor: not-allowed;
}

.test-actions {
  margin-bottom: 20px;
}

.test-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.test-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.test-btn:hover:not(:disabled)::before {
  left: 100%;
}

.test-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.test-btn:disabled {
  background: #e9ecef;
  color: #6c757d;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.test-btn.testing {
  background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.test-btn.primary {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.test-result {
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  border-left: 4px solid;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.test-result.success {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left-color: #28a745;
  color: #155724;
}

.test-result.error {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
  border-left-color: #dc3545;
  color: #721c24;
}

.result-header {
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-header.success::before {
  content: '✅';
  font-size: 20px;
}

.result-header.error::before {
  content: '❌';
  font-size: 20px;
}

.result-message {
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.result-data {
  margin-top: 16px;
}

.result-data strong {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
  color: #495057;
}

.result-data pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 16px;
  border-radius: 6px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  border: 1px solid rgba(0, 0, 0, 0.1);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* 测试模式选择器 */
.test-mode-selector {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: #f8f9fa;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.mode-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  color: #6c757d;
}

.mode-btn.active {
  background: white;
  color: #667eea;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
  transform: translateY(-1px);
}

.mode-btn:hover:not(.active) {
  color: #495057;
  background: rgba(255, 255, 255, 0.5);
}

/* 快速测试 */
.quick-test {
  margin-bottom: 20px;
}

.test-cases-info {
  margin-top: 20px;
  padding: 20px;
  background: #f8f9ff;
  border-radius: 8px;
  border: 1px solid #e8e8ff;
  border-left: 4px solid #667eea;
}

.test-cases-info h4 {
  margin: 0 0 16px 0;
  color: #495057;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-cases-info h4::before {
  content: '📋';
  font-size: 18px;
}

.test-cases-info ul {
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.test-cases-info li {
  margin-bottom: 12px;
  color: #6c757d;
  padding: 8px 12px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #667eea;
  font-size: 14px;
  line-height: 1.5;
}

.test-cases-info li::before {
  content: '•';
  color: #667eea;
  font-weight: bold;
  margin-right: 8px;
}

/* 高级测试 */
.advanced-test {
  margin-bottom: 20px;
}

/* 测试历史 */
.test-history {
  margin-top: 24px;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}

.test-history h4 {
  margin: 0 0 16px 0;
  color: #495057;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.test-history h4::before {
  content: '📊';
  font-size: 18px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 16px;
  background: white;
  border-radius: 6px;
  border-left: 4px solid;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.history-item.success {
  border-left-color: #28a745;
}

.history-item.error {
  border-left-color: #dc3545;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.test-name {
  font-weight: 600;
  color: #495057;
  font-size: 14px;
}

.test-time {
  font-size: 12px;
  color: #6c757d;
}

.test-duration {
  font-size: 12px;
  color: #6c757d;
  background: #e9ecef;
  padding: 2px 6px;
  border-radius: 3px;
}

.history-message {
  font-size: 13px;
  color: #6c757d;
  margin-bottom: 8px;
  line-height: 1.4;
}

.history-data {
  margin-top: 8px;
}

.history-data summary {
  cursor: pointer;
  font-size: 12px;
  color: #667eea;
  font-weight: 500;
  padding: 4px 0;
}

.history-data summary:hover {
  color: #495057;
}

.history-data pre {
  margin-top: 8px;
  background: #f8f9fa;
  padding: 12px;
  border-radius: 4px;
  font-size: 11px;
  overflow-x: auto;
  border: 1px solid #e9ecef;
}

/* 结果时间样式 */
.result-time {
  font-size: 12px;
  opacity: 0.8;
  font-weight: normal;
  margin-left: 8px;
}

.test-btn.primary:hover:not(:disabled) {
  background: #218838;
}

/* 结果时间显示 */
.result-time {
  font-size: 12px;
  color: #6c757d;
  margin-left: 8px;
}

/* 测试历史 */
.test-history {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.test-history h4 {
  margin: 0 0 16px 0;
  color: #495057;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 4px;
  border-left: 4px solid;
}

.history-item.success {
  background: #d4edda;
  border-left-color: #28a745;
}

.history-item.error {
  background: #f8d7da;
  border-left-color: #dc3545;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.test-name {
  font-weight: 600;
  color: #495057;
}

.test-time, .test-duration {
  font-size: 12px;
  color: #6c757d;
}

.history-message {
  font-size: 14px;
  color: #6c757d;
}

.history-data {
  margin-top: 8px;
}

.history-data summary {
  cursor: pointer;
  font-size: 12px;
  color: #007bff;
  margin-bottom: 8px;
}

/* 流程图样式 */
.test-flow-diagram {
  margin-top: 20px;
}

.test-flow-diagram h4 {
  margin-bottom: 16px;
  color: #495057;
  font-weight: 600;
}

.flow-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-step-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.flow-step {
  width: 100%;
  padding: 16px;
  border-radius: 8px;
  border: 2px solid;
  transition: all 0.3s ease;
  position: relative;
}

.flow-step.pending {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

.flow-step.running {
  background: #fff3cd;
  border-color: #ffc107;
  color: #856404;
  animation: pulse 2s infinite;
}

.flow-step.success {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.flow-step.error {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

.step-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  flex-shrink: 0;
}

.flow-step.pending .step-number {
  background: #e9ecef;
  color: #6c757d;
}

.flow-step.running .step-number {
  background: #ffc107;
  color: #856404;
}

.flow-step.success .step-number {
  background: #28a745;
  color: white;
}

.flow-step.error .step-number {
  background: #dc3545;
  color: white;
}

.step-title {
  font-weight: 600;
  flex: 1;
}

.step-status {
  font-size: 12px;
  font-weight: 500;
}

.step-description {
  font-size: 14px;
  opacity: 0.8;
  margin-left: 36px;
}

.step-error {
  margin-top: 12px;
  padding: 12px;
  background: rgba(220, 53, 69, 0.1);
  border-radius: 6px;
  border-left: 4px solid #dc3545;
}

.step-error .error-icon {
  font-size: 16px;
  margin-bottom: 4px;
}

.step-error .error-message {
  font-weight: 600;
  margin-bottom: 8px;
  color: #721c24;
}

.step-error .error-suggestion {
  font-size: 13px;
  color: #856404;
  background: #fff3cd;
  padding: 8px;
  border-radius: 4px;
  border-left: 3px solid #ffc107;
}

.flow-arrow {
  font-size: 20px;
  color: #dee2e6;
  margin: 4px 0;
  transition: color 0.3s ease;
}

.flow-arrow.active {
  color: #28a745;
}

.history-data pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  max-height: 200px;
  overflow-y: auto;
}
